package com.leon.security.service.impl;

import com.leon.security.pojo.Admin;
import com.leon.security.service.AdminService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
@Service
public class AdminServiceImpl implements AdminService {
    List<Admin> adminList = new ArrayList<>();
    private AdminServiceImpl(){
        adminList.add(new Admin(1,"001","123456","百京"));
        adminList.add(new Admin(2,"002","123456","上嗨"));
        adminList.add(new Admin(3,"003","123456","黑广"));
    }
    @Override
    public Admin login(String userName) {
        for (Admin admin : adminList) {
            if(userName.equals(admin.getAname())){
                return admin;
            }
        }
        return null;
    }
}
